package com.kittlen.managementSystem.mapper;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.kittlen.managementSystem.entity.Choice;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * 学员选择表 Mapper 接口
 * </p>
 *
 * @author kittlen
 * @since 2021-01-26
 */
public interface ChoiceMapper extends BaseMapper<Choice> {

    @Select("SELECT ch.*,co.fullname,co.photo,co.phone,co.email,co.agender FROM t_choice ch LEFT JOIN t_coach as co on ch.coach_id = co.coach_id ${ew.customSqlSegment}")
    @ResultMap("com.kittlen.managementSystem.mapper.ChoiceMapper.resultMap")
    List<Choice> selects(@Param(Constants.WRAPPER) Wrapper wrapper);

    @Override
    int insert(@Param("choice")Choice choice);
}
